<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // Promise这个构造函数的静态方法
        // Promise.resolve()  快速创建一个成功的promise实例
        // Promise.reject()   快速创建一个失败的promise实例

        const res = Promise.resolve(5) ;
        console.log(res);
        res.then(data => {
            console.log(data);  // 5
        })


        const p2 = Promise.reject(1) ;
        p2.catch(err => {
            console.log(err);
        })

        

    </script>
    
</body>
</html>